package com.zx.cloud.domain;

import java.time.OffsetDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zx.cloud.domain.enums.ResourceStatus;
import com.zx.cloud.model.BasicDomain;
import com.zx.cloud.util.converter.jackson.OffsetDateTimeToIso8601Serializer;

import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * sys_resource-资源
 *
 */
@ToString
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}, ignoreUnknown = true)
public class Resource extends BasicDomain{

	private static final long serialVersionUID = 1L;
    
	/**
	 * 菜单资源名称
	 */
	@ApiModelProperty(value = "菜单资源名称")
    private String name;
	/**
	 * 菜单资源URL
	 */
	@ApiModelProperty(value = "菜单资源URL")
    private String url;
	/**
	 * 菜单资源简要描述
	 */
	@ApiModelProperty(value = "菜单资源简要描述")
    private String remark;
	/**
	 * 父级id
	 */
	@ApiModelProperty(value = "父级id")
    private Long parentId;
	/**
	 * 菜单的层级结构
	 */
	@ApiModelProperty(value = "菜单的层级结构")
    private String structure;
	/**
	 * 排序号
	 */
	@ApiModelProperty(value = "排序号")
    private Long sortNo;
	/**
	 * 记录生成人
	 */
	@ApiModelProperty(value = "记录生成人")
    private String createUser;
	/**
	 * 记录生成时间
	 */
	@ApiModelProperty(value = "记录生成时间")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime createDate;
	/**
	 * 最后更新人
	 */
	@ApiModelProperty(value = "最后更新人")
    private String updateUser;
	/**
	 * 最后更新时间
	 */
	@ApiModelProperty(value = "最后更新时间")
	@JsonSerialize(using = OffsetDateTimeToIso8601Serializer.class)
    private OffsetDateTime updateDate;
	/**
	 * 是否是后台菜单资源  1:是 2:不是
	 */
	@ApiModelProperty(value = "是否是后台菜单资源  1:是 2:不是")
    private Integer isMenu;
	/**
	 * 状态: 0:启用 1:删除
	 */
	@ApiModelProperty(value = "状态: 0:启用 1:删除")
    private ResourceStatus status;
	/**
	 * 子资源
	 */
	@ApiModelProperty(value = "子资源")
	private List<Resource> resources;
	/**
	 * 资源码
	 */
	@ApiModelProperty(value = "子资源码")
	private String code;
	/**
	 * 父级图标
	 */
	@ApiModelProperty(value = "父级图标")
	private String icon;
	
	
    public Resource(){
    
    }
    
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Long getParentId() {
        return this.parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public String getStructure() {
        return this.structure;
    }
    
    public void setStructure(String structure) {
        this.structure = structure;
    }
    public Long getSortNo() {
        return this.sortNo;
    }
    
    public void setSortNo(Long sortNo) {
        this.sortNo = sortNo;
    }
    public String getCreateUser() {
        return this.createUser;
    }
    
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public OffsetDateTime getCreateDate() {
        return this.createDate;
    }
    
    public void setCreateDate(OffsetDateTime createDate) {
        this.createDate = createDate;
    }
    public String getUpdateUser() {
        return this.updateUser;
    }
    
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }
    public OffsetDateTime getUpdateDate() {
        return this.updateDate;
    }
    
    public void setUpdateDate(OffsetDateTime updateDate) {
        this.updateDate = updateDate;
    }
    public Integer getIsMenu() {
        return this.isMenu;
    }
    
    public void setIsMenu(Integer isMenu) {
        this.isMenu = isMenu;
    }
    public ResourceStatus getStatus() {
        return this.status;
    }
    
    public void setStatus(ResourceStatus status) {
        this.status = status;
    }

	public List<Resource> getResources() {
		return resources;
	}

	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}
	
	
}
